package situ.autoweter.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import situ.autoweter.service.BeOrderliteService;
import situ.autoweter.entity.BeOrderlite;
import java.util.*;
/**
 * BeOrderlite的路由接口服务
 * 
 * @author 胡文
 *
 */
@Controller
public class BeOrderliteController {

	/** BeOrderliteService服务 */
	@Autowired
	private BeOrderliteService beOrderliteService;
	
	/**
	 * 查询所有BeOrderlite数据的方法
	 * @param value
	 * @return
	 */
	@RequestMapping(value = "queryBeOrderlite", produces = {"application/json;charset=UTF-8"})
	public String find(BeOrderlite value,Map map) {
		 List<BeOrderlite> list= beOrderliteService.find(value);
         map.put("items",list);
         return "页面名称自己改";
	}
	
	/**
	 * 通过id查询BeOrderlite数据的方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "queryBeOrderliteById/{id}", produces = {"application/json;charset=UTF-8"})
	public String findOne(@PathVariable(name="id") Object id,Map map) {
        BeOrderlite obj=  beOrderliteService.findOne(id);
        map.put("BeOrderlite",obj);
        return "页面名称自己改";
	}
	
	/**
	 * 插入BeOrderlite属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "saveBeOrderlite", produces = {"application/json;charset=UTF-8"})
	public String save(BeOrderlite value) {
		  beOrderliteService.saveNotNull(value);
        return "redirect:/queryBeOrderlite";
	}
	
	/**
	 * 更新BeOrderlite属性不为空的数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "updateBeOrderlite", produces = {"application/json;charset=UTF-8"})
	public String update(BeOrderlite value) {
		  beOrderliteService.updateNotNullById(value);
          return "redirect:/queryBeOrderlite";
	}
	
	/**
	 * 通过id删除BeOrderlite数据方法
	 * 
	 * @return
	 */
	@RequestMapping(value = "delBeOrderliteById/{id}", produces = {"application/json;charset=UTF-8"})
	public String delete(@PathVariable(name="id") Object id) {
		  beOrderliteService.deleteById(id);
          return "redirect:/queryBeOrderlite";
	}
}
